<template>
  <div>
        <div class="suoyous">
      <div v-for="(item,index) in list" :key="index" 
      class="list_ys2"
      @click="onClickSuoyouList(item)">
          <div class="list_icon12">
              <img :src="item.icon" alt="">
          </div>
          <div>
              {{item.name}}
          </div>
      </div>
  </div>
  </div>
</template>

<script>
export default {
    data(){
        return{
            list:JSON.parse(localStorage.getItem("jujia")) || [],
        }
    },
    mounted(){
        // console.log(this.$route.query.item);
        this.list = this.$route.query.item
        console.log(this.list);
    },
        methods:{
        onClickSuoyouList(item){
            this.$router.push({
                path:"/searchlist",
                query:{
                    id:item.id
                }
            })
        }
    }
}
</script>

<style>
.list_icon12
{
    width: 100%;
}
.list_icon12 img
{
    width: 100%;
}
.list_ys2
{
    width: 25%;
    height:5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.5rem;
}
.suoyous
{
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
}
</style>